1
From Linear to Structured Reasoning: The Evolution of Chain-of-Thought
AI012 Lesson 4
00:00

From Linear to Structured Reasoning

What is the Evolution of Reasoning?

The evolution of Chain-of-Thought (CoT) represents a fundamental shift in how Large Language Models process complex tasks. It marks the transition from models providing a single, continuous "stream of consciousness" to navigating complex, multi-path logic architectures.

Why Move Beyond Linear CoT?

The Linear Baseline (Standard CoT): In standard CoT, models generate intermediate steps sequentially. While highly effective for simple word problems, it suffers from a critical flaw: it lacks the ability to backtrack or explore alternative solutions if it makes an early mistake.

Modern Reasoning Shifts (The "o1" Paradigm): Models like OpenAI o1 and DeepSeek-R1 extend reasoning length significantly. They perform "digit alignment" and internal verification before finalizing an output, proving that complex problems require deliberate planning rather than intuitive guessing.

How Structured Reasoning Works

  • Program of Thought (PoT): Decouples reasoning from calculation. Instead of trying to solve math directly in text, the model generates code (e.g., Python) to solve logic/math tasks. For example, to find the roots of $x^2 + 2x + 1 = 0$, it writes a script rather than guessing the algebra.
  • Tree-of-Thoughts (ToT): Allows the model to branch out into multiple "thought" candidates. It evaluates these branches and prunes dead ends, acting much like a classic search algorithm (e.g., A* or Monte Carlo Tree Search).
  • Graph-of-Thoughts (GoT): Represents reasoning as a network. Information can be aggregated from multiple independent nodes, allowing for non-linear dependencies where separate lines of thought merge into a single conclusion.
Key Insight
Decomposing complex problems into modular "thought nodes" allows models to move beyond simple next-token prediction toward deliberate planning and verification.
reasoning_logic.py
TERMINAL bash — 80x24
> Ready. Click "Run" to execute.
>
Question 1
Which reasoning structure is best suited for tasks requiring "look-ahead" planning and the ability to abandon dead-end ideas?
Linear Chain-of-Thought (CoT)
Tree-of-Thoughts (ToT)
Program of Thought (PoT)
Zero-Shot Prompting
Question 2
In the Program of Thought (PoT) framework, what performs the actual mathematical computation?
The LLM's internal weights
The Self-Attention mechanism
An external code interpreter or program execution
A dedicated math-only neural network
Challenge: Design a GoT Workflow
Apply Graph-of-Thoughts to a research summary task.
You are designing a Graph-of-Thought (GoT) workflow for an AI agent tasked with writing a comprehensive research summary.
Task 1
Create three independent thought nodes to analyze different aspects of the research paper.
Solution:
You would instantiate three parallel processes or prompts:
node_1 = analyze("Methodology")
node_2 = analyze("Results")
node_3 = analyze("Limitations")
Task 2
Create a final node that demonstrates the "Graph" nature by aggregating data from all three previous nodes.
Solution:
The final node takes the outputs of the previous independent nodes as its input, forming a graph structure rather than a simple tree or line.
synthesis_node = aggregate([node_1, node_2, node_3])
final_summary = generate_summary(synthesis_node)